package com.shuoyue.ycgk.ui.papergroups.groupcommon;

import android.content.Context;
import android.content.Intent;

import com.shuoyue.ycgk.entity.Paper;
import com.shuoyue.ycgk.entity.UserTestPaper;
import com.shuoyue.ycgk.ui.papergroups.BasePaperGroupInfoActivity;
import com.shuoyue.ycgk.ui.questionbank.practice.paperset.questionitem.DoPaperActivity;

public class PaperCommonInfoActivity extends BasePaperGroupInfoActivity {
    /**
     * @param sourse
     * @param id
     * @param type   //查询类型 1:历年真题  -1:题库 2:时政热点  3:自由组卷  4:我的题集
     */
    public static void start(Context sourse, int id, int type, int subjectTypeId) {
        sourse.startActivity(new Intent(sourse, PaperCommonInfoActivity.class)
                .putExtra("id", id).putExtra("type", type).putExtra("subjectTypeId", subjectTypeId));
    }


    @Override
    protected void initView() {
        isLisScroll = true;
        type = getIntent().getIntExtra("type", -1);
        super.initView();

    }


    @Override
    protected void createPaper(Paper paper) {
        createPresenter.createSetPaper(paper.getId(), paper.getName());
    }

    @Override
    public void createPaperSuc(UserTestPaper userTestPaper) {
        if (type == 2) {
            DoPaperActivity.startHot(mContext, userTestPaper);
        } else {
            super.createPaperSuc(userTestPaper);
        }

    }

}
